package com.app.mvc.acl.util;import com.app.mvc.acl.domain.SysUser;import javax.servlet.http.HttpServletRequest;/** * Created by jimin on 16/1/16. */public class RequestHolder {    private static final ThreadLocal<SysUser> userHolder = new ThreadLocal<>();    private static final ThreadLocal<HttpServletRequest> requestHolder = new ThreadLocal<>();    public static void add(SysUser sysUser) {        userHolder.set(sysUser);    }    public static void add(HttpServletRequest request) {        requestHolder.set(request);    }    public static SysUser getCurrentUser() {        return userHolder.get();    }    public static HttpServletRequest getCurrentRequest() {        return requestHolder.get();    }    public static void remove() {        userHolder.remove();        requestHolder.remove();    }}